package cn.itcast.order.Client;

import cn.itcast.order.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//1.编写FeignClient接口
//@FeignClient("服务名")
//通过指定注解中的属性来指定降级处理类
@FeignClient(value = "userservice",fallback = UserClientFallback.class)
public interface UserClient {
//    2.重写远程调用的方法
    @GetMapping("/user/{id}")
    User queryById(@PathVariable("id") Long id);
}
